//
//  BLCommentTableViewCell.m
//  百思不得姐
//
//  Created by hbl on 16/3/29.
//  Copyright © 2016年 hbl. All rights reserved.
//

#import "BLCommentTableViewCell.h"
#import "BLUser.h"
#import <YYWebImage.h>
#import "BLComment.h"
@interface BLCommentTableViewCell()
@property (weak, nonatomic) IBOutlet UIImageView *headImageView;
@property (weak, nonatomic) IBOutlet UIImageView *sexImagView;
@property (weak, nonatomic) IBOutlet UILabel *nameLabel;
@property (weak, nonatomic) IBOutlet UILabel *contentLabel;
@property (weak, nonatomic) IBOutlet UILabel *likeLabel;

@end

@implementation BLCommentTableViewCell

- (void)awakeFromNib {
    [super awakeFromNib];
    // Initialization code
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}

- (void)setComment:(BLComment *)comment
{
    _comment = comment;
    self.nameLabel.text = comment.user.username;
    self.contentLabel.text = comment.content;
    self.likeLabel.text = comment.like_count;
    if ([comment.user.sex  isEqual: @"m"]) {
        self.sexImagView.image = [UIImage imageNamed:@"Profile_manIcon"];
    }else{
        self.sexImagView.image = [UIImage imageNamed:@"Profile_womanIcon"];
    }
    [self.headImageView setYy_imageURL:[NSURL URLWithString:comment.user.profile_image]];
    self.headImageView.layer.cornerRadius = 17.5;
    self.headImageView.clipsToBounds = YES;
    
}

- (void)setFrame:(CGRect)frame
{
     frame = CGRectMake(5, frame.origin.y, frame.size.width - 10, self.comment.cellHight - 1);
    
    [super setFrame:frame];
}

@end
